﻿/// <summary>
/// Developer: CHOOI KAH WAI
/// Last Modified: 7/10/2009
/// </summary>

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using System.Windows.Threading;
using System.Threading;
using ARSS.Client;
using System.IO;

namespace ARSS
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        public App()
        {
            App.Current.Exit += new ExitEventHandler(Current_Exit);
            ShutdownMode = ShutdownMode.OnExplicitShutdown;

            Logger.Instance.DirectoryName = "ClientLog";
            Logger.Instance.IsActivated = true;

            try
            {
                Core.Instance.Init();
                Logger.Instance.Log("System initialized.");
                Core.Instance.CurrentState = Core.emSTATE.emINIT;
            }
            catch (Exception ex)
            {
                Logger.Instance.Log(ex.Message);
                App.Current.Shutdown();
            }
        }

        void Current_Exit(object sender, ExitEventArgs e)
        {
            Logger.Instance.Log("System shut down.");
        }
    }

    
}
